import java.util.Arrays;
import java.util.Scanner;

public class LotteryDrawing {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            System.out.print("How many numbers do you need to draw? ");
            int k = in.nextInt();

            System.out.print("What is the highest number you can draw? ");
            int n = in.nextInt();

            // 使用 1 2 3 . . . n 填充 数组
            int[] numbers = new int[n];
            for (int i = 0; i < numbers.length; i++) {
                numbers[i] = i + 1;
            }

            // 从 numbers 数组中选出 k 个元素，放入结果数组 result
            int[] result = new int[k];
            for (int i = 0; i < result.length; i++) {
                // 随机选取一个索引
                int r = (int) (Math.random() * n);

                // 将这个索引对应的数放入结果数组
                result[i] = numbers[r];

                // 将 numbers[r] 替换为 numbers[n-1]
                // 这样确保 numbers[r] 不再被选中
                numbers[r] = numbers[n - 1];
                n--;
            }

            // 输出结果
            Arrays.sort(result);
            System.out.println("Bet the following combination. It'll make you rich!");
            for (int num : result) {
                System.out.println(num);
            }
        }
    }
}
